class Animal{
    public String name;
    public int age;
}
class Dog extends Animal{
    public void bark(){
        System.out.println(name + "叫");
    }
}

class Cat extends Animal{
    public void run(){
        System.out.println(name + "抓老鼠");
    }
}

public class test2 {
    public static void main(String[] args) {
        Dog d1 = new Dog();
        d1.name = "小花";
        d1.bark();
        Cat c1 = new Cat();
        c1.name = "小猫";
        c1.run();
//        Dog t1 = new Dog();
//        t1.age = 10;
//        t1.name = "小黄";
//        t1.bark();
    }
}
